import 'package:flutter/material.dart';
import 'package:english_words/english_words.dart';

class RandomWordsWidget extends StatefulWidget {
  RandomWordsWidget({required super.key});

  final GlobalKey<RandomWordsWidgetState> stateKey = GlobalKey();

  @override
  RandomWordsWidgetState createState() => RandomWordsWidgetState();
}

class RandomWordsWidgetState extends State<RandomWordsWidget> {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: Text("RandomWordsWidget: $wordPair"),
    );
  }

  WordPair wordPair = WordPair.random();
  void refresh() {
    setState(() {
      wordPair = WordPair.random();
    });
  }
}
